<template>
  <!-- <img alt="Vue logo" src="./assets/logo.png"> -->
  <!-- <HelloWorld msg=""/> -->
  <input type="text" v-model="message" placeholder="edit"/>
  <button type="button" v-on:click="reverseMsg">反转字符串</button>
  <h1>{{message}}</h1>
  <a v-bind:href="url">百度</a>
  <button type="button" v-on:click="displayHidenContent">显示隐藏内容</button>
  <p v-if="display">隐藏内容</p>
</template>

<script>
// import HelloWorld from './components/HelloWorld.vue';
export default {
  name: 'App',
  // components: {
  //   HelloWorld,
  // },
  data() {
    return {
      message: 'hello',
      url: 'http://www.baidu.com',
      display: false,
    };
  },
  methods: {
    reverseMsg() {
      this.message = this.message.split('').reverse().join('');
    },
    displayHidenContent() {
      this.display = !this.display;
    },
  },
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
